import apiClient from './apiClient';
import { ProjectInfo, ProjectScanResult } from '../../types';

export const projectService = {
  // 扫描项目
  scan: async (): Promise<ProjectScanResult> => {
    return await apiClient.get<any, ProjectScanResult>('/project/scan');
  },
  
  // 获取项目详情
  getDetail: async (projectPath: string): Promise<ProjectInfo> => {
    return await apiClient.get<any, ProjectInfo>(`/project${encodeURIComponent(projectPath)}`);
  },
};

export default projectService; 